//
//  CCArmatureFactory.h
//  FlashAnimation
//
//  Created by chiawei.tseng on 12/12/24.
//
//

#ifndef CCArmatureFactory_H
#define CCArmatureFactory_H

#include "cocos2d.h"
#include "Singleton.h"
#include <map>
#include <string>

using namespace std;
using namespace cocos2d;

struct SPRITE_BATCH_NODE;
typedef map<string,SPRITE_BATCH_NODE> mapSpriteBatchNode;

struct SPRITE_BATCH_NODE
{
    CCSpriteBatchNode* pSpriteBatchNode;
    bool               bIsAddChild;
    
    SPRITE_BATCH_NODE()
    {
        pSpriteBatchNode = NULL;
        bIsAddChild = false;
    }
    
    SPRITE_BATCH_NODE(CCSpriteBatchNode* ptr)
    {
        pSpriteBatchNode = ptr;
        bIsAddChild = false;
    }
};

class CCArmature;
class CCArmatureFactory : public Singleton<CCArmatureFactory>
{
public:
    
    CCArmatureFactory(){}
    
    virtual ~CCArmatureFactory();
    
    CCArmature* CreateArmature(const char* pArmatureName ,const char* pAnimationName ,const char* pnlName);
    
    void UseSpriteBatchNode(CCNode* , const char* PngName);
    
    void ReSetSpriteBathNode(const char* PngName);
    
    void ReSetAllSpriteBathNode();
    
    void Register(const char* XmlName,const char* PngName , const char* PlsitName);
    
     CCSpriteBatchNode* GetSpriteBatchNode(const char* PngName);
    
    void UnRegister();
    
    virtual void Init();
    
protected:
    
    //CCArmatureFactory();
    
    
    
private:
    
   
    
    mapSpriteBatchNode m_pSpriteBatchNodeSet;
    
};



#endif
